package com.eurasia.assignment.domain;

import java.time.LocalDateTime;

import com.eurasia.assignment.infrastructure.entity.FileEntity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 提交领域对象
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Submission {
    private String id;
    private Long projectId;
    private String description;
    private String submitterId;
    private FileEntity file;
    private LocalDateTime submissionTime;
    private String reviewResult;
    private SubmissionStatus reviewStatus;
    private String type;
    private Long reviewerId;
    private LocalDateTime reviewTime;
    
    /**
     * 创建新的提交
     */
    public static Submission create(Long projectId, String description, String type, String submitterId, FileEntity file) {
        Submission submission = new Submission();
        submission.setProjectId(projectId);
        submission.setDescription(description);
        submission.setType(type);
        submission.setSubmitterId(submitterId);
        submission.setFile(file);
        submission.setSubmissionTime(LocalDateTime.now());
        submission.setReviewStatus(SubmissionStatus.PENDING);
        return submission;
    }
} 